import { getDaliyUnInsuranceCompanyList } from '@/api/insurance/company'
import type { InsuranceCompanyBalanceSaleDto } from '@/api/insurance/company/types'
import type { PageDto, PagesDto } from '@/api/types'
import type { FilterDto } from '@/render/FilterRender'
import TableRender, { type TableRenderColumnTypes } from '@/render/TableRender'
import type { AnyObject } from '@/types'
import toNative from '@/utils/toNative'
import { Button } from 'ant-design-vue'
import { Component } from 'vue-facing-decorator'
import Render from '@/render/Render'
import type { VxeColumnSlotTypes, VxeGridProps, VxeGridPropTypes, VxeTableDataRow } from 'vxe-table'

@Component
export class GroupBalanceNotUse extends TableRender {
    filterConfig(): FilterDto {
        return {
            searchText: {
                name: '客户或商务名称',
                element: 'input',
            }
        }
    }
    onLoadData(pageNum: number, pageSize: number, filters: AnyObject){
        return getDaliyUnInsuranceCompanyList({
            searchText: filters.searchText,
            pageNum,
            pageSize,
            productType: 2,
            sortField: this.sortFields[0]?.field ?? '',
            sortType: this.sortFields[0]?.order ?? '',
        })
    }

    tableColumnConfigOld = () => [
        {
            field: 'companyName',
            title: '客户名称',
        },
        {
            field: 'businessPrincipal',
            title: '商务负责人',
        },
        {
            field: 'deptName',
            title: '所属分组',
        },
        {
            field: 'productOpenTime',
            title: '开通时间',
            sortable: true
        },
        {
            field: 'accountBalance',
            title: '账户余额',
            sortable: true,
            slots: {
                default: 'price'
            }
        },
        {
            field: 'operate',
            title: '操作',
            fixed: 'right',
            slots: {
                default: ({ row, column }: VxeColumnSlotTypes.ContentSlotParams<InsuranceCompanyBalanceSaleDto>) => {
                    return <>
                        <Button type="text">查看详情</Button>
                    </>
                }
            }
        }
    ] as TableRenderColumnTypes<InsuranceCompanyBalanceSaleDto>



}

export default toNative(GroupBalanceNotUse)
